import React from'react';

function ChildComponent(props:any) {
    return (
        <div>
            <h2>Child Component</h2>
            {/* 子组件通过 props 接收父组件传递的数据和函数 */}
            <p>{props.message}</p>
            <button onClick={props.onButtonClick}>Click Me</button>
        </div>
    );
}

export default ChildComponent;